[0-9a-zA-Z]* string expressed with primes or prime-factorization-style way to break it into parts?
Posted
by
HH
on Stack Overflow
See other posts from Stack Overflow
or by HH
Published on 2010-12-30T23:54:19Z
Indexed on
2010/12/31
22:53 UTC
Read the original article
Hit count: 230
Suppose a string consists of numbers and alphabets. You want to break it into parts, an analogy is primes' factorization, but how can you do similar thing with strings [0-9a-zA-Z]*
or even with arbitrary strings? I could express it in alphabets and such things with octal values and then prime-factorize it but then I need to keep track of places where I had the non-numbers things. Is there some simple way to do it? I am looking for simple succinct solutions and don't want too much side-effects.
[Update] mvds has the correct idea, to change the base, how would you implement it?
© Stack Overflow or respective owner